-- GENERATED SPELL FOR [Enraged Earth Spirit] --


function spell0_21050(pUnit, Event) --@Fel Fire Aura,Self--
pUnit:FullCastSpellOnTarget(36006,pUnit)
pUnit:RegisterEvent('Sorts_21050', 584, 1)
end

function spell1_21050(pUnit, Event) --@Fiery Boulder,n/a--
pUnit:FullCastSpellOnTarget(38498,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_21050', 1500, 1)
end

function spell2_21050(pUnit, Event) --@Summon Enraged Earth Shard,Self--
pUnit:FullCastSpellOnTarget(38365,pUnit)
pUnit:RegisterEvent('Sorts_21050', 633, 1)
end

function Sorts_21050(pUnit, Event)
local choix_sorts_21050 = math.random(0, 2)
if choix_sorts_21050 == 0 then
pUnit:RegisterEvent('spell0_21050', 1, 1)
end
if choix_sorts_21050 == 1 then
pUnit:RegisterEvent('spell1_21050', 1, 1)
end
if choix_sorts_21050 == 2 then
pUnit:RegisterEvent('spell2_21050', 1, 1)
end
end

function mob21050_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_21050', math.random(1500, 3000), 1)
end

function mob21050_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21050_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob21050_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(21050, 1, 'mob21050_Action')
RegisterUnitEvent(21050, 2, 'mob21050_Leave')
RegisterUnitEvent(21050, 3, 'mob21050_Kill')
RegisterUnitEvent(21050, 4, 'mob21050_Die')
